<template>
  <div>
    <div style="width: 500px;">
      <h2 style="text-align: center">请输入您要生成二维码的文本</h2>
      <div style="float: top" @click="faile">
        <el-input
            size="medium"
            v-model="textarea"
            :rows="4"
            type="textarea"
            placeholder="请输入"
        />
        
      </div>
      <div style="float: top;margin-top: 50px;margin-left: 100px">
        <a @click="go" >GGG</a>
      </div>
    </div>
    <div>
      <vue-qr v-if=flag :text=textarea :size="250" style="margin-left: 75px;margin-top: 150px" colorDark="#4169E1" colorLight="#fff"></vue-qr>
    </div>
  </div>
</template>

<script>
export default {
  name: "Text",
  data() {
    return {
      flag:false,
      textarea: ''
    }
  },
  methods: {
    go(){
        this.flag=true
    },
    faile(){
      this.flag=false
    }
  }
}
</script>

<style scoped>
a::before{
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  bottom: -5px;
  top: -5px;
  background: linear-gradient(90deg,#03a9f4,#f441a5,#ffeb3b,#03a9f4);
  background-size: 400%;
  border-radius: 50px;
  filter:blur(10px);
  z-index: -1;
}

a {
  line-height: 70px;
  text-align: center;
  position: absolute;
  font-weight: 700;
  font-size:24px;
  background: linear-gradient(90deg,#03a9f4,#f441a5,#ffeb3b,#03a9f4);
  background-size: 400%;
  height: 70px;
  width: 200px;
  border-radius: 50px;
  z-index: 1;
}

@keyframes sun {
  100%{
    background-position: -400% 0;
  }
}

a:hover::before{
  animation: sun 8s infinite;
}
a:hover {
  animation: sun 8s infinite;
}
</style>
